<?php
namespace Home\Widget;
use Think\Controller;

/**
* 微信事件处理
*/
class EventWidget extends Controller
{
	
	public function index($data)
	{
		$wx = new \Common\Lib\Weixin\Weixin();
		if ( $data['Event']['Event'] == 'subscribe' ) {
			$result = array(
                'MsgType' => 'text',
                'Content' => '感谢您的关注！所有功能正在开发中，请您耐心等待！'
            );
		}
		
		return $wx->toWeixin($result);
	}

	public function cxkj($data)
	{
		$wx = new \Common\Lib\Weixin\Weixin();
		if ( $data['Event']['Event'] == 'subscribe' ) {
			$result = array(
                'MsgType' => 'text',
                'Content' => '感谢您的关注！所有功能正在开发中，请您耐心等待！'
            );
		}
		if ( $data['Event']['Event'] == 'CLICK' ) {
			if ( $data['Event']['EventKey'] == 'V1001_TODAY_MUSIC' ) {
				$result = array(
	                'MsgType' => 'text',
	                'Content' => '点击功能正在开发中，请您耐心等待！'
            	);
			}
			
		}
		
		return $wx->toWeixin($result);
	}
}